<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<link href="__PUBLIC__/admin/sncss/css/style.css" rel="stylesheet" type="text/css" />
<link href="__PUBLIC__/admin/sncss/css/combo.select.css" rel="stylesheet" type="text/css" />

</head>

<body>
	<div class="formbody">

	<div class="formtitle"><span>字数转移</span></div>
	  	<form method="post" enctype="multipart/form-data" onsubmit="return form1_submit();" action="{:U('/Home/Media/remove_words')}" >
			<ul class="forminfo">
				<li>
					<label>当前自媒体ID</label>
					<input type="text" class="dfinput" value="{$media_info.mmid}" disabled="disabled"/>
				</li>
				<li>
					<label>当前自媒体名称</label>
					<input type="text" class="dfinput" value="{$media_info.media_name}" disabled="disabled"/>
				</li>
				<li>
					<label>当前自媒体字数</label>
					<input type="text" class="dfinput" value="{$media_info.wordnumber}+{$media_info.grantnumber}" disabled="disabled"/>
				</li>
				<li>
					<label>可选择的自媒体</label>
					<select class="timebody1 newselect" name="new_mmid" id="new_mmid">
						<option value ="0" >请选择</option>
						<volist name="media_list" id="vo">
							<option value="{$vo.mmid}">{$vo.media_name}({$vo.mmid})</option>
						</volist>
					</select>
					<input type="hidden" id="old_mmid" name="old_mmid" value="{$media_info.mmid}">
					<input type="hidden" id="jumpurl" name="jumpurl" value="{$jumpurl}">
				</li>
				<li>
					<label>转移字数</label>
					<input name="remove_words" id="remove_words" type="number" class="dfinput" onkeyup="if(this.value.length==1){this.value=this.value.replace(/[^1-9]/g,'')}else{this.value=this.value.replace(/\D/g,'')}" onafterpaste="if(this.value.length==1){this.value=this.value.replace(/[^1-9]/g,'0')}else{this.value=this.value.replace(/\D/g,'')}"/>
				</li>
				<li>
					<label>签约金额</label>
					<input type="text" name="signmoney" id="signmoney" class="dfinput" value="" />
				</li>
				<li>
					<label>备注</label>
					<input type="text" id="remark" name="remark" class="lginput" value="" />
				</li>
				<li>
					<label>&nbsp;</label><a href="javascript:;" class="btn" style="padding:7px 40px;" id="qr" onclick="form1_submit()">确认</a>
					<!--<input name="" type="submit" class="btn" value="确认"/>-->
				</li>
			</ul>
  		</form>
	</div>
</body>
<script src="__PUBLIC__/js/jquery1.8.3.js"></script>
<script src="__PUBLIC__/layer/layer.js"></script>
</html>
<script type="text/javascript">
	function form1_submit(){
	    var new_mmid = $('#new_mmid').val();
	    var remove_words = $('#remove_words').val();
	    var signmoney = $('#signmoney').val();
	    var old_mmid = $('#old_mmid').val();
	    var jumpurl = $('#jumpurl').val();
	    var remark = $('#remark').val();
        if(new_mmid.length==0||new_mmid==0){
            layer.msg('请选择要转移的自媒体');return false;
        }
        if(remove_words==''||remove_words<=0){
            layer.msg('请输入正确的转移字数');return false;
        }
        if(signmoney==''||signmoney<=0){
            layer.msg('请填写签约金额');return false;
		}
		//换用ajax提交
        $.ajax({
            url:"/Home/Media/remove_words",
            dataType:"json",
            data:{"new_mmid":new_mmid,"remove_words":remove_words,"signmoney":signmoney,"old_mmid":old_mmid,"jumpurl":jumpurl,"remark":remark},
            type:"post",
            success:function(data){
                if (data.code == '000000') {
                    window.parent.location.reload();
                    alert('转移成功');
                    var index1 = parent.layer.getFrameIndex(window.name);
                    parent.layer.close(index1)
                } else {
                    alert(data.message);
                }
            },
        });

	}
</script>
